package structural.facade;

public class NotificationServer {
    // connect() -> Connection
    // authenticate(appID, key) -> AuthToken
    // sendMessage(message, token, target) -> boolean
    // conn.disconnect() -> void

    public Connection connect(String ipAddress) {
        Connection connection = new Connection();
        connection.connect();
        return connection;
    }

    public AuthToken authenticate(String appID, String key) {
        // Logic to authenticate and return an AuthToken
        System.out.println("Authenticated with appID: " + appID);
        return new AuthToken();
    }

    public boolean sendMessage(Message message, AuthToken token, String target) {
        // Logic to send the message
        System.out.println("Message sent to " + target + ": " + message.content());
        return true; // Assuming the message was sent successfully
    }

    public void disconnect(Connection connection) {
        if (connection != null) {
            connection.disconnect();
        } else {
            System.out.println("No connection to disconnect.");
        }
    }
}
